package reflect;

import java.lang.reflect.Array;
import java.lang.reflect.Method;

public class ReflectDemo1 {
    public static void main(String[] args) {
        //Class cls = String.class;
        Class cls = Array.class;
        String className = cls.getName();
        System.out.println(className);
        className = cls.getSimpleName();
        System.out.println(className);
        System.out.println(cls);

        Package pack = cls.getPackage();
        String pName = pack.getName();
        System.out.println("包名：" + pName);

        Method[] methods = cls.getMethods();
        System.out.println("方法个数：" + methods.length);
        for (Method method : methods) {
            System.out.println(method.getName());
        }



    }
}
